<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除样式removeClass</title>
    <style>
        .left,
        .right {
            width: 300px;
            height: 120px;
        }
        .left div,
        .right div {
            width: 100px;
            height: 90px;
            padding: 5px;
            margin: 5px;
            float: left;
            border: 1px solid #ccc;
        }
        .newClass{
            background: #bbffaa;
        }
        .imoocClass{
            background: red;
        }

    </style>
    <script src="../jquery-3.4.1.js"></script>
</head>
<body>
<h2>.removeClass()方法</h2>
<div class="left">
    <div class="aaron newClass">
        <p>newClass</p>
    </div>
    <div class="aaron newClass">
        <p>newClass</p>
    </div>
</div>
<div class="right">
    <div class="aa bb imoocClass">
        <article>
            <p>imoocClass</p>
        </article>
    </div>
    <div class="jljjjljlj">
        <article>
            <p>imoocClass</p>
        </article>
    </div>
</div>
</body>
<script type="text/javascript">
    $(".left div").removeClass("newClass")
    $(".right > div:first").removeClass(function (index,className) {
        //把div的className赋给下一个兄弟元素div上作为它的class
        $(this).next().addClass(className);
        //删除自己本身的imoocClass
        return "imoocClass"
    })
</script>
</html>